#! /usr/bin/python

import sys
import os
import re

if __name__ == "__main__":

    pwd = os.getcwd()

    for file in os.listdir(pwd):
        if os.path.isdir(file):
            os.chdir(file)
        else:
            continue

        if os.path.exists("script.py"):
            cmd="rm -rf result"
            os.system(cmd)
            cmd="make"
            os.system(cmd)
            cmd= "./script.py"
            os.system(cmd)
            cmd="make clean"
            os.system(cmd)

        os.chdir(pwd)

